{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Logistic Regression 逻辑斯谛回归\n",
    "\n",
    "LR是经典的分类方法"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "回归模型：$f(x) = \\frac{1}{1+e^{-wx}}$\n",
    "\n",
    "其中wx线性函数：$wx =w_0*x_0 + w_1*x_1 + w_2*x_2 +...+w_n*x_n,(x_0=1)$\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from math import exp\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "%matplotlib inline\n",
    "\n",
    "from sklearn.datasets import load_iris\n",
    "from sklearn.model_selection import train_test_split"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# data\n",
    "def create_data():\n",
    "    iris = load_iris()\n",
    "    df = pd.DataFrame(iris.data, columns=iris.feature_names)\n",
    "    df['label'] = iris.target\n",
    "    df.columns = ['sepal length', 'sepal width', 'petal length', 'petal width', 'label']\n",
    "    data = np.array(df.iloc[:100, [0,1,-1]])\n",
    "    # print(data)\n",
    "    return data[:,:2], data[:,-1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "X, y = create_data()\n",
    "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "class LogisticReressionClassifier:\n",
    "    def __init__(self, max_iter=200, learning_rate=0.01):\n",
    "        self.max_iter = max_iter\n",
    "        self.learning_rate = learning_rate\n",
    "        \n",
    "    def sigmoid(self, x):\n",
    "        return 1 / (1 + exp(-x))\n",
    "\n",
    "    def data_matrix(self, X):\n",
    "        data_mat = []\n",
    "        for d in X:\n",
    "            data_mat.append([1.0, *d])\n",
    "        return data_mat\n",
    "\n",
    "    def fit(self, X, y):\n",
    "        # label = np.mat(y)\n",
    "        data_mat = self.data_matrix(X) # m*n\n",
    "        self.weights = np.zeros((len(data_mat[0]),1), dtype=np.float32)\n",
    "\n",
    "        for iter_ in range(self.max_iter):\n",
    "            for i in range(len(X)):\n",
    "                result = self.sigmoid(np.dot(data_mat[i], self.weights))\n",
    "                error = y[i] - result \n",
    "                self.weights += self.learning_rate * error * np.transpose([data_mat[i]])\n",
    "        print('LogisticRegression Model(learning_rate={},max_iter={})'.format(self.learning_rate, self.max_iter))\n",
    "\n",
    "    # def f(self, x):\n",
    "    #     return -(self.weights[0] + self.weights[1] * x) / self.weights[2]\n",
    "\n",
    "    def score(self, X_test, y_test):\n",
    "        right = 0\n",
    "        X_test = self.data_matrix(X_test)\n",
    "        for x, y in zip(X_test, y_test):\n",
    "            result = np.dot(x, self.weights)\n",
    "            if (result > 0 and y == 1) or (result < 0 and y == 0):\n",
    "                right += 1\n",
    "        return right / len(X_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "LogisticRegression Model(learning_rate=0.01,max_iter=200)\n"
     ]
    }
   ],
   "source": [
    "lr_clf = LogisticReressionClassifier()\n",
    "lr_clf.fit(X_train, y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1.0"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lr_clf.score(X_test, y_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.legend.Legend at 0x2241c4edcc0>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl8VfW57/HPQxKSMMYQxgwmJIjIICCCCELAOiFVrFal\n2h61LQXpaXtsbfVebwdPe6r13mpbpoJWalWsI1qOw7GSMIMNg4AguhOGJEwhmDAlIdn53T920Bgz\nrCRr7zXkeb9evJK9slj7+e2lDyu/9d2/LcYYlFJK+UsnpwtQSillP23uSinlQ9rclVLKh7S5K6WU\nD2lzV0opH9LmrpRSPqTNXSmlfEibu1JK+ZA2d6WU8qFop544KSnJpKenO/X0SinlSZs3bz5mjOnd\n0n6Wm7uIRAF5QLExZnqDn2UDrwN76za9aox5uLnjpaenk5eXZ/XplVJKASKy38p+rbly/yGwG+jR\nxM/XNGz6SimlnGFpzl1EUoDrgSfDW45SSik7WL2h+gTwU6C2mX0uF5HtIvKWiAxtbAcRmSUieSKS\nV1JS0tpalVJKWdTitIyITAeOGmM2182tN2YLkGaMOSUi04DlwKCGOxljFgOLAcaMGaNrDSulHFFd\nXU1RURGVlZVOl9KkuLg4UlJSiImJadPftzLnPgG4oa5pxwE9RORZY8yd53Ywxpyo9/2bIrJARJKM\nMcfaVJVSSoVRUVER3bt3Jz09HRFxupwvMcZQWlpKUVERGRkZbTpGi9MyxpgHjTEpxph04HZgZf3G\nDiAi/aTuFRKRsXXHLW1TRUopFWaVlZX06tXLlY0dQETo1atXu36zaHPOXURmAxhjFgG3AHNEpAao\nAG43+hFPSikXc2tjP6e99bWquRtjcoHcuu8X1ds+D5jXrkqU8pHlW4t57J09HCyrYEBCPPdfM5gZ\no5KdLkt1ILr8gFI2W761mAdf3UFxWQUGKC6r4MFXd7B8a7HTpSkXefvttxk8eDBZWVk88sgjth9f\nm7tSNnvsnT1UVAe/sK2iOshj7+xxqCLlNsFgkLlz5/LWW2+xa9culi1bxq5du2x9DsfWllHKrw6W\nVbRq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jNhE5ISI/arBPRM6JlQ/rcNoPgd1Aj0Z+dh0wqO7P\nOGBh3Vc3am4cAGuMMdMjWE97TDHGNJXX9dI5aW4c4I1z8gfgbWPMLSLSGejS4OdeOR8tjQM8cD6M\nMXuAkRC6oCP0caOvNdgtIufE1VfuIpICXA882cQuNwLPmJCNQIKI9I9YgRZZGIefeOKc+IGI9AQm\nEfoYTIwxZ40xZQ12c/35sDgOL7oSyDfGNHyzZkTOiaubO/AE8FOgtomfJwOF9R4X1W1zm5bGAXB5\n3a9ob4nI0AjV1RYG+KeIbBaRWY383CvnpKVxgPvPSQZQAjxdN+X3pIh0bbCPF86HlXGA+89HQ7cD\nyxrZHpFz4trmLiLTgaPGmM1O19IeFsexBUgzxowA/gQsj0hxbTPRGDOS0K+Wc0VkktMFtVFL4/DC\nOYkGRgMLjTGjgNPAA86W1CZWxuGF8/GZuqmlG4CXnKrBtc2d0Adz3yAi+4AXgKki8myDfYqB1HqP\nU+q2uUmL4zDGnDDGnKr7/k0gRkSSIl6pBcaY4rqvRwnNJY5tsIsXzkmL4/DIOSkCiowxm+oev0yo\nSdbnhfPR4jg8cj7quw7YYow50sjPInJOXNvcjTEPGmNSjDHphH69WWmMubPBbm8A36q7+3wZUG6M\nORTpWptjZRwi0k9EpO77sYTOS2nEi22BiHQVke7nvgeuBnY22M3158TKOLxwTowxh4FCERlct+lK\nYFeD3Vx/PqyMwwvno4GZND4lAxE6J15Iy3yBiMwGMMYsAt4EpgEB4Axwt4OltUqDcdwCzBGRGqAC\nuN24891lfYHX6v4fiwaeN8a87cFzYmUcXjkn/w48VzcNUADc7cHzAS2Pwyvn49wFw1XA9+pti/g5\n0XeoKqWUD7l2WkYppVTbaXNXSikf0uaulFI+pM1dKaV8SJu7Ukr5kDZ3pZTyIW3uSinlQ9rclVLK\nh/4/2nEMn3PSDR8AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x2241c0e65c0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "x_ponits = np.arange(4, 8)\n",
    "y_ = -(lr_clf.weights[1]*x_ponits + lr_clf.weights[0])/lr_clf.weights[2]\n",
    "plt.plot(x_ponits, y_)\n",
    "\n",
    "#lr_clf.show_graph()\n",
    "plt.scatter(X[:50,0],X[:50,1], label='0')\n",
    "plt.scatter(X[50:,0],X[50:,1], label='1')\n",
    "plt.legend()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## sklearn\n",
    "\n",
    "### sklearn.linear_model.LogisticRegression\n",
    "\n",
    "solver参数决定了我们对逻辑回归损失函数的优化方法，有四种算法可以选择，分别是：\n",
    "- a) liblinear：使用了开源的liblinear库实现，内部使用了坐标轴下降法来迭代优化损失函数。\n",
    "- b) lbfgs：拟牛顿法的一种，利用损失函数二阶导数矩阵即海森矩阵来迭代优化损失函数。\n",
    "- c) newton-cg：也是牛顿法家族的一种，利用损失函数二阶导数矩阵即海森矩阵来迭代优化损失函数。\n",
    "- d) sag：即随机平均梯度下降，是梯度下降法的变种，和普通梯度下降法的区别是每次迭代仅仅用一部分的样本来计算梯度，适合于样本数据多的时候。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from sklearn.linear_model import LogisticRegression"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "clf = LogisticRegression(max_iter=200)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LogisticRegression(C=1.0, class_weight=None, dual=False, fit_intercept=True,\n",
       "          intercept_scaling=1, max_iter=200, multi_class='ovr', n_jobs=1,\n",
       "          penalty='l2', random_state=None, solver='liblinear', tol=0.0001,\n",
       "          verbose=0, warm_start=False)"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "clf.fit(X_train, y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1.0"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "clf.score(X_test, y_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[ 1.92455724 -3.20503018]] [-0.52573053]\n"
     ]
    }
   ],
   "source": [
    "print(clf.coef_, clf.intercept_)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.legend.Legend at 0x2241c7cc908>"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEKCAYAAAD9xUlFAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl8FfW5+PHPQwKEsMoiWwgBAi4gu4gKApHbKlpxrxbt\ndelFQbS9rbW19tfe29a22l0iIFVvqyLeat2qyG0lgIALZZFFEAkkQNiJAoGQkOX5/TEnIaRZhmQm\nZ+ac5/16ndfJmcyZ83zPaB5mvvPMI6qKMcYYA9As2gEYY4wJDksKxhhjKllSMMYYU8mSgjHGmEqW\nFIwxxlSypGCMMaaSJQVjjDGVfE8KIpIgImtF5K0afjdeRI6IyMeRx4/8jscYY0ztEpvgM74JbAba\n1fL7Zap6dRPEYYwxph6+JgURSQGuAh4Fvu3FNjt37qxpaWlebMoYY+LG6tWrD6lql/rW8/tI4ffA\nQ0DbOta5RETWA7uBB1X1k7o2mJaWxqpVqzwM0RhjYp+I7HCznm9zCiJyNXBAVVfXsdoaIFVVBwMz\ngddr2dZUEVklIqsOHjzoQ7TGGGPA34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yEygDPh/OPfrKQCygHWq+r6IvAm8\npaqvRMYDkKiqo0RkEvBjYGJDvihjqrOkYGLRBuA3IvIYzh/TZSIyCOcP/T8if1QTgKr3ipkPoKrv\niUi7yB/ytsCfRaQ/zu2ym59BDF/CuZnhg5HXSUBq5OdFqnoEQEQ2Ab2BzsBSVf08svxlYEAd2381\n8rwaSDuDuIypkyUFE3NU9TNx2hNOAn4mIotw7mb6iapeXNvbanj9U2Cxql4nImnAkjMIQ4AbIl20\nTi0UuQjnCKFCGQ37/7BiGw19vzE1sjkFE3NEpAdQqKovAL/COSWzBegikb69ItJcTm+yUjHvMAbn\njpNHgPacuh3xHWcYxv8B91e5K+ewetb/JzBORM4SkUROP01VgHPUYozvLCmYWHQBzjn8j3HOt/9M\nVU/i3CXzMRFZB3wMXFLlPUUishaYA9wdWfY48IvI8jP91/hPcU43rReRTyKvaxXp0fBzYCWwAsgF\njkR+/RLw3ciEdb+at2CMN+wuqSbuicgS4EFVXRXlONqo6rHIkcJrwLOqWr1huzG+siMFY4LjvyJH\nNxuBHALeLtLEJjtSMMYYU8mOFIwxxlSypGCMMaaSJQVjjDGVLCkYY4ypZEnBGGNMJUsKxhhjKv1/\nKrGqjTEvHgYAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x2241c759358>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "x_ponits = np.arange(4, 8)\n",
    "y_ = -(clf.coef_[0][0]*x_ponits + clf.intercept_)/clf.coef_[0][1]\n",
    "plt.plot(x_ponits, y_)\n",
    "\n",
    "plt.plot(X[:50, 0], X[:50, 1], 'bo', color='blue', label='0')\n",
    "plt.plot(X[50:, 0], X[50:, 1], 'bo', color='orange', label='1')\n",
    "plt.xlabel('sepal length')\n",
    "plt.ylabel('sepal width')\n",
    "plt.legend()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
